package com.powergisol.gis.service;

import com.powergisol.gis.config.ServiceFeignConfig;
import com.powergisol.gis.service.impl.FallBackServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Date: 2019/8/6  18:40
 * Description:
 */
@FeignClient(value = "gis-ows",fallback = FallBackServiceImpl.class,configuration = ServiceFeignConfig.class)
public interface FallBackService {

    @RequestMapping(value = "/gis/getLayer",method = RequestMethod.GET)
    String getLayer(@RequestParam(value = "name") String name,@RequestParam(value = "fileUrl")String fileUrl,
                    @RequestParam(value = "styleUrl")String styleUrl,@RequestParam(value = "encodingType")String encodingType);

    @RequestMapping(value = "/gis/getLayerTable",method = RequestMethod.GET)
    String getLayerTable(@RequestParam(value = "name") String name,@RequestParam(value = "fileUrl")String fileUrl,
                         @RequestParam(value = "styleUrl")String styleUrl,@RequestParam(value = "encodingType")String encodingType);

    @RequestMapping(value = "/gis/getLayerTable/{index}",method = RequestMethod.GET)
    String getLayerTableData(@RequestParam(value = "name") String name, @RequestParam(value = "index") Integer index,@RequestParam(value = "fileUrl")String fileUrl,
                             @RequestParam(value = "styleUrl")String styleUrl,@RequestParam(value = "encodingType")String encodingType);

    @RequestMapping(value = "/gis/getLayerType",method = RequestMethod.GET)
    String getLayerType(@RequestParam(value = "fileUrl")String fileUrl,@RequestParam(value = "encodingType")String encodingType);

    @RequestMapping(path = {"/gis/getLayerTable/{row}"}, method = RequestMethod.GET)
    String getLayerTableDetail(@PathVariable(value = "row") int row, @RequestParam(value = "name") String name, @RequestParam(value = "fileUrl") String fileUrl,
                               @RequestParam(value = "styleUrl") String styleUrl, @RequestParam(value = "encodingType") String encodingType);
}

